<template>
  <formitem-wapper :formitem="formitem">
    <j-markdown-editor v-decorator="[formitem.key,{initialValue:''}]" :id="id"></j-markdown-editor>
  </formitem-wapper>
</template>

<script>
  import FormitemWapper from './../FormitemWapper.vue'
  import {FormItemMixin} from './../FormItenMixin'

  export default {
    name: 'MarkdownWidget',
    mixins:[FormItemMixin],
    components:{
      FormitemWapper,
    },
    computed: {
      id() {
        // 确保ID的唯一性
        return this.formitem.key + '-' + new Date() + ((Math.random() * 1000).toFixed(0) + '')
      },
    },
  }
</script>
